import { defineComponent } from 'vue';
import GLayout from '/@/shared/components/g-layout/index.vue';
import { EsignView } from './components';
import printJS from 'print-js';
export default defineComponent({
  components: { GLayout, EsignView },
  data() {
    return {
      value: null,
      columns: [
        {
          title: '序号',
          dataIndex: 'order',
          key: 'order',
          width: 80,
        },
        {
          title: '品名',
          dataIndex: 'name',
          key: 'name',
          width: 150,
        },
        {
          title: '规格',
          dataIndex: 'standards',
          key: 'standards',
          width: 100,
        },
        {
          title: '数量',
          dataIndex: 'num',
          key: 'num',
          width: 60,
        },
        {
          title: '单位',
          dataIndex: 'unit',
          key: 'unit',
          width: 60,
        },
        {
          title: '单价',
          dataIndex: 'unitprice',
          key: 'unitprice',
        },
        {
          title: '金额',
          dataIndex: 'total',
          key: 'total',
        },
        {
          title: '备注',
          dataIndex: 'remarks',
          key: 'remarks',
        },
      ],
      dataSource: [
        {
          order: '1',
          name: '服务器硬件',
          standards: '联想',
          num: '5',
          unit: '台',
          unitprice: '20000.00',
          total: '100000.00',
          remarks: '',
        },
        {
          order: '2',
          name: '数据库正版',
          standards: 'SQLServer',
          num: '5',
          unit: '套',
          unitprice: '9998.00',
          total: '49990.00',
          remarks: '',
        },
        {
          order: '3',
          name: 'OA内部管理系统',
          standards: '定制',
          num: '5',
          unit: '套',
          unitprice: '	390000.00',
          total: '	390000.00',
          remarks: '',
        },
        {
          order: '4',
          name: '进销存管理系统',
          standards: '定制',
          num: '5',
          unit: '套',
          unitprice: '260000.00',
          total: '260000.00',
          remarks: '',
        },
        {
          order: '5',
          name: '	服务费',
          standards: '',
          num: '5',
          unit: '年',
          unitprice: '80000.00',
          total: '80000.00',
          remarks: '',
        },
        {
          order: '6',
          name: '差旅费用',
          standards: '',
          num: '5',
          unit: '年',
          unitprice: '60000.00',
          total: '80000.00',
          remarks: '',
        },
      ],
    };
  },
  methods: {
    handleClearClick() {
      this.value = null;
    },
    handleOkClick(val) {
      this.value = val;
    },
    print() {
      printJS({
        printable: 'print',
        type: 'html',
        // css: ['/src/assets/print-style/print.css', 'src/app/sample/esign/index.less'],
        css: ['print-style/print.css', './index.less'],
        // css: ['./index.less'],
        targetStyles: ['*'],
      });
    },
  },
});
